Example 1:
===============
// This program averages test scores. It asks the user for the
// number of students and the number of test scores per student.
#include <iostream.h>
#include <conio.h>
void main(void)
{
	int numStudents, numTests, total;
	float average;

	cout << "This program averages test scores.\n";
	cout << "For how many students do you have scores? ";
	cin >> numStudents;
	cout << "How many test scores does each student have? ";
	cin >> numTests;
for (int count1 = 1; count1 <= numStudents; count1++)
	{
		total = 0;      // Initialize accumulator
		for (int count2 = 1; count2 <= numTests; count2++)
		{
			int score;
			cout << "Enter score " << count2 << " for ";
			cout << "student " << count1 << ": ";
			cin >> score;
			total += score;    // accumulate running total
		}
		average = total / numTests;
		cout << "The average score for student " << count1;
		cout << " is " << average << ".\n\n";
	}
getch();
}




Example 2:

===============
// This program raises the user's number to the powers
// of  0 through 10.

#include <iostream.h>
#include <math.h>
#include <conio.h>
void main(void)
{
clrscr();
	int value;
	char choice;

	cout << "Enter a number: ";
	cin >> value;
	cout << "This program will raise " << value;
	cout << " to the powers of 0 through 10.\n";
for (int count = 0; count < 10; count++)
	{
		cout << value << " raised to the power of ";
		cout << count << " is " << pow(value, count);
		cout << "\nEnter Q to quit or any other key ";
		cout << "to continue. ";
		cin >> choice;
		if (choice == 'Q' || choice == 'q')
			break;
	}
getch();
}


Example 3:
===============
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();

for ( int count = 1;count <= 10;count++)
{
if (count == 5 )
continue;
else
cout<<count<<"\n";
}
getch();
}


Example 4:
===============
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();

for ( int count = 1;count <= 10;count++)
{
if (count == 5 )
break;
else
cout<<count<<"\n";
}
getch();
}



Example 5:
===============

#include <iostream.h>
#include <conio.h>
void main(void)
{
float max=0;

float Avg;
clrscr();
for ( int count1=1;count1<=3;count1++)
	{
	int sum=0;
	   cout<<"enter the scores for student "<<count1<<"\n|";
	   cout<<" enter s1.s2.s3|\n";
	for ( int count2=1;count2<=3;count2++)
		{
		int score;
		cin>>score;
		sum=sum + score;
		}
		Avg=sum/3;
		cout<<"avg 4 student "<<count1 <<" is "<< Avg <<"\n";
	if ( max < Avg )
	max=Avg;

	}
 
	cout<<"max avg is " << max;
      getch();
}

example5:
=============
#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();
for ( int count1=1;count1<=10;count1++)
	{
	for (int count2=1;count2<=10;count2++)
		{
		cout<<count1<<" * "<< count2 <<" = " <<(count1*count2)<<"\t";
		}

		cout<<"\n\n";
	}
	getch();
}


example 6:
===========

#include <iostream.h>
#include <conio.h>
void main(void)
{
clrscr();
cout<<"Letter"<<"\t"<<" Asciicode\n";
for ( char count1= 'A';count1 <='Z';count1++)
	{

		 cout<< count1<<"\t"<<int(count1);

		cout<<"\n";
	}
	getch();
}



